|
|
|
|
|
|
|
Listing 17.2 MAINMDI.TXTUse Menu Code to Handle the Tasks of the Contact Manager |
|
|
|
|
|
|
|
|
Private Sub filExit_Click()
Unload Me
End Sub
Private Sub MDIForm_Load()
Me.WindowState = vbMaximized
End Sub
Private Sub MDIForm_Unload(Cancel As Integer)
CustDb.Close
End Sub
Private Sub memCreate_Click()
Dim CheckSet As Boolean
CheckSet = Not memCreate.Checked
memCreate.Checked = CheckSet
CreateForm = CheckSet
End Sub
Private Sub memNew_Click()
If CreateForm Then
Dim frmMem As New frmMember
frmMem.Show
End If
ClearCust
End Sub
Private Sub memSearch_Click()
frmSearch.Show vbModal
If CreateForm Then
Dim frmMem As New frmMember
frmMem.Show
End If
ShowCust
End Sub |
|
|
|
|
|
|
|
|
Setting Up the Customer Child Form |
|
|
|
|
|
|
|
|
The next step in creating the contact manager is setting up the child form that displays a customer's information. To set up the customer form, add a form to your project (or use the initial form that was created) and then set its MDIChild property to True. You probably also need to change the Name and Caption properties of the form. (Set the name of the form to frmMember to match the code in the menu items.) After setting the properties of the form, you need to add controls to the form to display the data. The completed form is shown in Figure 17.19. |
|
|
|
|
|